package com.platform.hjt.sys.model;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * SysCompanyModel entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_company_model")
public class SysCompanyModel implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 200522332855025572L;
	private SysCompanyModelId id;
	private SysModel sysModel;
	private SysCompanyInfo sysCompanyInfo;

	// Constructors

	/** default constructor */
	public SysCompanyModel() {
	}

	/** minimal constructor */
	public SysCompanyModel(SysCompanyModelId id) {
		this.id = id;
	}

	/** full constructor */
	public SysCompanyModel(SysCompanyModelId id, SysModel sysModel,
			SysCompanyInfo sysCompanyInfo) {
		this.id = id;
		this.sysModel = sysModel;
		this.sysCompanyInfo = sysCompanyInfo;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "sysModelId", column = @Column(name = "sys_model_id", length = 32)),
			@AttributeOverride(name = "sysCompanyInfo", column = @Column(name = "sys_company_info", length = 32)) })
	public SysCompanyModelId getId() {
		return this.id;
	}

	public void setId(SysCompanyModelId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_model_id", insertable = false, updatable = false)
	public SysModel getSysModel() {
		return this.sysModel;
	}

	public void setSysModel(SysModel sysModel) {
		this.sysModel = sysModel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_company_info", insertable = false, updatable = false)
	public SysCompanyInfo getSysCompanyInfo() {
		return this.sysCompanyInfo;
	}

	public void setSysCompanyInfo(SysCompanyInfo sysCompanyInfo) {
		this.sysCompanyInfo = sysCompanyInfo;
	}

}